Sync settings before/after opening document#1083
Sync settings before/after opening document#1083martinRenou merged 10 commits intogeojupyter:mainfrom
Conversation
|
Integration tests report: appsharing.space |
| React.useEffect(() => { | ||
| const syncFromSettingsRegistry = async () => { | ||
| const registry = await props.model.getSettings(); | ||
| const composite = registry?.composite; |
There was a problem hiding this comment.
I need a little help understanding this pattern of merging composite with the previous value of settings. From the docs, composite is "The composite of user settings and extension defaults.", which I read to mean the current actual settings. Is that right?
There was a problem hiding this comment.
Yes you are correct. composite represents the effective settings after merging defaults, system, and user overrides, so it is the current source of truth from the settings registry.
Sure we can omit the merging of previous value into the composite.
There was a problem hiding this comment.
I've read some of the other code where we access settings (tools.ts) and I'm confused about why it's done the way it's done. Perhaps we could write some docs on this (different PR).
Co-authored-by: Nakul Verma <173621577+nakul-py@users.noreply.github.com>
Co-authored-by: Nakul Verma <173621577+nakul-py@users.noreply.github.com>
mfisher87
left a comment
There was a problem hiding this comment.
I think this looks great but I also would love to hear from @martinRenou if he has any suggestions (e.g. can the code be more idiomatic?), since there are some aspects of the settings API I'm still not 100% comfortable about :)
martinRenou
left a comment
There was a problem hiding this comment.
Makes sense to me! Thanks
* Sync settings before/after opening document * Refactor * Revert bugfix for zoom controls Co-authored-by: Nakul Verma <173621577+nakul-py@users.noreply.github.com> * Un-unpack settings from props Co-authored-by: Nakul Verma <173621577+nakul-py@users.noreply.github.com> * Lint 🔔 Co-authored-by: Nakul Verma <173621577+nakul-py@users.noreply.github.com> * lint --------- Co-authored-by: Matt Fisher <mfisher87@gmail.com> Co-authored-by: Nakul Verma <173621577+nakul-py@users.noreply.github.com>
Description
Syncing settings before/after opening document and with respect to being changed from setting registry.
Screencast.From.2026-01-18.16-48-52.mp4
Checklist
Resolves #XXX.Failing lint checks can be resolved with:
pre-commit run --all-filesjlpm run lint📚 Documentation preview: https://jupytergis--1083.org.readthedocs.build/en/1083/
💡 JupyterLite preview: https://jupytergis--1083.org.readthedocs.build/en/1083/lite